import Api from '@/api/payment/currency'
import i18n from "@/lang/index";
const modalConfig = {
  pageName: 'sys:user',
  dialog: {
    title: i18n.global.t("title.15"),
    width: 800,
    appendToBody: true,
    draggable: true,
    labelWidth: "auto",
  },
  formAction: (data) => {
    console.log('edit', data)
    return new Promise((resolve, reject) => {
      Api.put(data).then((s) => {
        console.log(s)
        resolve(s)
      }).catch((e) => {
        reject(e)
      })
    })
  },
  formItems: [
    {
      type: "input",
      label: "ID",
      prop: "id",
      attrs: {
        disabled: true
      },
    },
    {
      type: "input",
      label: i18n.global.t("form.52"),
      prop: "code",
      attrs: {
        placeholder: i18n.global.t("hint.76"),
      },
    },
    {
      type: "upload",
      label: i18n.global.t("form.53"),
      prop: "image",
      attrs: {
        placeholder: i18n.global.t("hint.77"),
      },
    },
    {
      type: "input",
      label: i18n.global.t("form.54"),
      prop: "symbol",
      attrs: {
        placeholder: i18n.global.t("hint.78"),
      },
    },
  ],
  formRules: {
    code: [{ required: true, message: i18n.global.t("hint.76"), trigger: "blur" }],
    image: [{ required: true, message: i18n.global.t("hint.77"), trigger: "blur" }],
    symbol: [{ required: true, message: i18n.global.t("hint.78"), trigger: "blur" }],
  },
}

export default modalConfig
